package com.wg.controller;

import com.wg.R;
import com.wg.service.AchievementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("achievements")
public class AchievementController {

    @Autowired
    AchievementService achievementService;

    @GetMapping
    public R getAchievementByUser(@RequestParam(name = "userId") Integer userId) {
        return achievementService.getAchievementByUser(userId);
    }
}
